<?php

/**
 * 门店
 *
 * Class ShopEntity
 */
class ShopEntityController extends BaseController
{
    use \app\library\traits\Restful;

    public function getnearestAction()
    {
        $request = $this->getRequest();
        $latitude = floatval($request->getQuery('latitude'));
        $longitude = floatval($request->getQuery('longitude'));
        if (empty($longitude) || empty($latitude)) {
            $this->noParams();
        }
        $list = (new ShopEntityModel())->getNearestByLocation($latitude, $longitude);
        return $this->returnSuccess($list);
    }
}
